<?php

$dbhost = "172.17.4.49";
$dbuser = "oxwangfeng";
$dbpwd = "oxwangfeng";
$dbname = "oxwf";
$conn = mysql_pconnect("$dbhost", "$dbuser", "$dbpwd");

function random($min, $max = NULL) {
    $len = isset($max) ? mt_rand($min, $max) : $min;
    $str = '';
    for ($i = 0; $i < $len; ++$i)
        $str .= chr(mt_rand(32, 128));
    return $str;
}

if (!$conn) {
    die('Could not connect: ' . mysql_error());
} else {
    print("connect ok!!<br />");
    mysql_select_db("$dbname", $conn);

    for ($orderid = 1; $orderid <= 100000; $orderid++) {
        $staticinfo = addslashes(trim(random(9000, 10000)));
        $incinfo = addslashes(trim(random(3000, 5000)));
        $status = addslashes(trim(random(10, 20)));
        $isextent = addslashes(trim(rand(0, 1)));

        mysql_query("INSERT INTO  t1 VALUES('','$staticinfo','$incinfo','$status',$isextent,NOW(),NOW());");
    }
    mysql_close($conn);
?>
